Author(s): Renato Sanchez
Published on Mon May 01 2023
Summary: in 2023 I explored the amazing NodeJS world for backend dev, I learned this.
Node works on just one thread, but implements something called a callback and take every task and assign a callback to it and when the task get complete, return the result to the callback.
Is a good choice for non blocking applications like tasks where is needed to consume external data and make connections, it’s not recommended for heavy processing data and processor intensive work.
Good for …
- web servers (for event driven applications & non blocking tasks)
- real time servers (web sockets connections)
- command line utilities
How does Node JS works?
First, node takes the JS code and uses the V8 motor (core js engine dev by Google), and run it on the runtime of Node JS, well but behind the scenes uses the libvu library for handling asynchronous tasks.
Useful packages
- Helmet: API security on requests and responses
- Squelize: ORM
- CookieParser: parse the cookies for server handling
- JOI: validation middleware for data in requests
- JWT: jsonwebtokens for nodejs, very useful for user sessions
- Bcrypt: for password hashing